package com.zhida.common.context;

/**
 * Create by zhh 2024/7/5 1:19
 */
public class UserContext {
    private static final ThreadLocal<String> userThreadLocal = new ThreadLocal<>();

    public static void setUser(String username) {
        userThreadLocal.set(username);
    }
    
    public static String getUser() {
        return userThreadLocal.get();
    }

    public static void clear() {
          userThreadLocal.remove();
    }
}
